#define _CRT_SECURE_NO_WARNINGS  1


#include <iostream>
using namespace std;

int main()
{
    string str;
    getline(cin, str);
    int pos = str.rfind(' ');
    if (pos != string::npos)
    {
        cout << str.size() - (pos + 1) << endl;
    }
    else
    {
        cout << str.size() << endl;
    }
    return 0;
}